package com.jinxin.platform.cdacscontrolmgr.bean.enums;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-03-03
 * @Author: Lingnan
 **/

/**
 * 车辆类型定义
 */
public enum CarTypeEnum {
    CODE_21("21","临时车"),
    CODE_22("22","月租车"),
    CODE_23("23","储值车"),
    CODE_24("24","免费车"),
    CODE_7F0D("7F0D","业主车"),
    CODE_07("07","此车无权限"),
    CODE_1E1F("1E1F","请等待人工确认"),
    CODE_0B("0B","请缴费");

    private String code;
    private String desc;

    CarTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    // 普通方法
    public static String getDesc(String code) {
        for (CarTypeEnum c : CarTypeEnum.values()) {
            if (c.getCode().equals(code)) {
                return c.desc;
            }
        }
        return null;
    }

    public static String getCarTypeCode(String desc) {
        for (CarTypeEnum c : CarTypeEnum.values()) {
            if (c.getDesc().equals(desc)) {
                return c.code;
            }
        }
        return CODE_21.code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
